xen: Fix failure paths for xentrace
authorGeorge Dunlap <george.dunlap@eu.citrix.com>
Thu, 12 Apr 2012 13:01:27 +0000 (14:01 +0100)
committerGeorge Dunlap <george.dunlap@eu.citrix.com>
Thu, 12 Apr 2012 13:01:27 +0000 (14:01 +0100)
commit2f9fd22f509da9ab5135c602892712bec07d8631
treedc665f1b3049928651c221aebff87f45d507fedd
parent498d19e3a652470a1de4d5ebe9bdf3be3aa12375
xen: Fix failure paths for xentrace

Problems this addresses:
* After the allocation of t_info fails, the path the code takes tries
to free t_info.  Jump past that part instead.
* The failure code assumes that unused data is zero; but the structure
is never initialized.  Zero the structure before using it.
* The t_info pages are shared with dom0 before we know that the whole
operation will succeed, and not un-shared afterwards.  Don't share the
pages until we know the whole thing will succeed.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
xen/common/trace.c